package com.atguigu.gmall.wms.mapper;

import com.atguigu.gmall.wms.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author fengge
 * @email fengge@atguigu.com
 * @date 2022-12-23 17:38:47
 */
@Mapper
public interface WareSkuMapper extends BaseMapper<WareSkuEntity> {


    //验库存
    List<WareSkuEntity> check(@Param("skuId") Long skuId, @Param("count") Integer count);

    //锁库存
    Integer lock(@Param(("count"))Integer count,@Param("id")Long id);

    //解锁
    Integer unlock(@Param("count")Integer count,@Param("id")Long id);

    void minus(@Param("count")Integer count,@Param("id")Long id);
}
